package com.scwatch.ext.repository;

import com.scwatch.ext.domain.StartPage;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.Repository;

import java.util.Collection;

public interface StartPageDao extends Repository<StartPage, Integer>{
     Page<StartPage> findAll(Specification<StartPage> spec , Pageable pageable);

    StartPage save(StartPage bean);

    StartPage findOne(Integer id);

    StartPage delete(StartPage bean);

    //专用于 启动
    @Modifying
    @Query(value = "update start_page bean set bean.is_start = ?1 ,bean.modify_time=?2 where bean.id in (?3)",nativeQuery = true)
     int updateIsStart(String isStart,String modifyTime,Collection<Integer> ids);

}
